#include "raytracer.h"

#include "stdbool.h"
#include "stdio.h"
#include "time.h"
#include "assert.h"

int main()
{
	/*vector a, c;
	
	vectorClear(&a);
	vectorClear(&c);
	
	printf("a:"); vectorPrintf(&a);
	printf("c:"); vectorPrintf(&c);

	c.x = 1.0f;
	c.y = 2.7f;
	
	vectorNormalize(&c);
	printf("c:"); vectorPrintf(&c);
	
	bool equal = vectorIsEqual(&a,&c);
	printf("a == c -> %d\n", (int)equal);*/
	
	srand(time(NULL));
	
	int f1 = framebufferCreate(RGB8, 1024, 768),
	    f2 = framebufferCreate(RGB8, 1024, 768);
	
	int x,y;
	for (y = 0; y < 768; y++)
		for(x = 0; x < 1024; x++)
				framebufferModify(f1, x, y, rand()%255, rand()%255, rand()%255, 0);

	for (y = 0; y < 768; y++)
	{
		int r = rand()%255,
		    g = rand()%255,
		    b = rand()%255;					
		for(x = 0; x < 1024; x++) framebufferModify(f2, x, y, r, g, b, 0);
	}

	imageWrite(framebufferGetFramebuffer(f1), PPM, "pixels.ppm");
	imageWrite(framebufferGetFramebuffer(f2), PPM, "lines.ppm");

	return 0;
}
